//
//  IcMaterial.m
//  IceClear
//
//  Created by P & C on 3/23/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "IcMaterial.h"


@implementation IcMaterial


@synthesize title;
@synthesize name;
@synthesize details;
@synthesize usageTypesGoodFor;
@synthesize precipitationTypesGoodFor;
@synthesize lowestPracticalTemperature;
@synthesize facilityTypesGoodFor;
@synthesize suggestedProducts;


-(id)initWithName:(NSString *)theName title:(NSString *)theTitle details:(NSString *)theDetails usageTypes:(NSArray *)u 
	facilityTypes:(NSArray *)f lowestTemperature:(NSInteger)t precipitationTypes:(NSArray *)p suggestedProducts:(NSArray *)sp {
	self = [super init];
	
	if (self) {
		self->title = [theTitle retain];
		self->name = [theName retain];
		self->details = [theDetails retain];
		self->usageTypesGoodFor = [u retain];
		self->facilityTypesGoodFor = [f retain];
		self->lowestPracticalTemperature = t;
		self->precipitationTypesGoodFor = [p retain];
		self->suggestedProducts = [sp retain];
	}
	
	return self;
}


- (void)encodeWithCoder:(NSCoder *)coder;
{
    [coder encodeObject:name forKey:@"name"];
    [coder encodeObject:title forKey:@"title"];
	[coder encodeObject:details forKey:@"details"];
	[coder encodeObject:usageTypesGoodFor forKey:@"usageTypesGoodFor"];
	[coder encodeObject:facilityTypesGoodFor forKey:@"facilityTypesGoodFor"];
	[coder encodeObject:precipitationTypesGoodFor forKey:@"precipitationTypesGoodFor"];
	[coder encodeObject:suggestedProducts forKey:@"suggestedProducts"];
	[coder encodeInteger:lowestPracticalTemperature forKey:@"lowestPracticalTemperature"];

}

- (id)initWithCoder:(NSCoder *)coder;
{
    self = [super init];
    if (self != nil)
    {
        self->name = [[coder decodeObjectForKey:@"name"] retain];
		self->title = [[coder decodeObjectForKey:@"title"] retain];
		self->details = [[coder decodeObjectForKey:@"details"] retain];
		self->usageTypesGoodFor = [[coder decodeObjectForKey:@"usageTypesGoodFor"] retain];
		self->facilityTypesGoodFor = [[coder decodeObjectForKey:@"facilityTypesGoodFor"] retain];
		self->precipitationTypesGoodFor = [[coder decodeObjectForKey:@"precipitationTypesGoodFor"] retain];
		self->suggestedProducts = [[coder decodeObjectForKey:@"suggestedProducts"] retain];
		lowestPracticalTemperature = [coder decodeIntegerForKey:@"lowestPracticalTemperature"];


		
    }   
    return self;
}


-(void)dealloc {
	[title release];
	[name release];
	[details release];
	[usageTypesGoodFor release];
	[precipitationTypesGoodFor release];
	[facilityTypesGoodFor release];
	[suggestedProducts release];
	[super dealloc];
}

@end
